package cn.tedu.store.controller;

import cn.tedu.store.entity.UserVisitLog;
import cn.tedu.store.service.IUserVisitLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/userVisitLog")
public class UserVisitLogController {
    @Autowired
    private IUserVisitLogService logService;
    /**
     * 保存用户浏览记录
     * @param log
     */
    @PostMapping("/save")
    public void saveVisitLog(@RequestBody UserVisitLog log) {
        logService.saveVisitLog(log);
    }
    /**
     * 用户登录查询用户购买记录
     * @param uid
     * @return
     */
    @PostMapping("/getCidByUid")
    public Integer getCidByUid(@RequestBody Integer uid) {
        return logService.getCidByUid(uid);
    }
}
